﻿<UserControl x:Class="ImageView.ViewImage"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:fluid="clr-namespace:FluidKit.Controls;assembly=FluidKit"
             xmlns:local="clr-namespace:ImageView"
             xmlns:common="clr-namespace:ImageUtils.Common;assembly=ImageUtils.Common"
             mc:Ignorable="d" 
             d:DesignHeight="469" d:DesignWidth="907">
    <Grid Background="#FF333333">
        <Grid.RowDefinitions>
            <RowDefinition/>
            <RowDefinition Height="40"/>
            <RowDefinition Height="25"/>
        </Grid.RowDefinitions>
        
        <fluid:TransitionPresenter x:Name="TransPres" Grid.Row="0" TransitionCompleted="TransPres_TransitionCompleted">
            <fluid:TransitionPresenter.Transition>
                <fluid:GenieTransition EffectType="IntoLamp"/>
            </fluid:TransitionPresenter.Transition>
            <local:FullImageView x:Name="ImgFull" Opacity="0"/>
            <Image x:Name="ImgCurrent" Stretch="Uniform" Opacity="1">
                <Image.LayoutTransform>
                    <TransformGroup>
                        <ScaleTransform x:Name="ImgScale" ScaleX="1" ScaleY="1"/>
                        <RotateTransform x:Name="ImgRot" Angle="0"/>
                    </TransformGroup>
                </Image.LayoutTransform>
            </Image>
        </fluid:TransitionPresenter>
        
        <Grid Grid.Row="1">
            <Grid.ColumnDefinitions>
                <ColumnDefinition/>
                <ColumnDefinition Width="300"/>
            </Grid.ColumnDefinitions>

            <StackPanel Grid.Column="0" Orientation="Horizontal" Background="#FF595959" >
                <Button x:Name="BtnPrev" Width="50" Click="BtnPrev_Click" Margin="10,0,0,0" VerticalAlignment="Top" ToolTip="Previous Image">
                    <Image Source="../images/player_start.png"/>
                </Button>
                <Button x:Name="BtnNext" Width="50" Click="BtnNext_Click" Margin="10,0,0,0" ToolTip="Next Image">
                    <Image Source="../images/player_end.png"/>
                </Button>

                <ToggleButton x:Name="BtnTimer" Width="50" Margin="10,0,0,0" Click="BtnTimer_Click" ToolTip="Start/Stop Slideshow">
                    <Image Source="../images/player_time.png"/>
                </ToggleButton>

                <StackPanel Margin="5,0,0,0" Width="150" VerticalAlignment="Center">
                    <common:EditableSlider x:Name="TimeSllider" Minimum="2" Maximum="30" Value="5" />
                    <ProgressBar Height="15" x:Name="TimeProgress" Minimum="0" Value="0" Maximum="{Binding ElementName=TimeSllider, Path=Value}" />
                </StackPanel>
            </StackPanel>

            <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Grid.Column="1" Background="#FF595959">
                <Button x:Name="RotCw" Width="50" Margin="0,0,10,0" Click="RotCw_Click" ToolTip="Rotate Clockwise">
                    <Image Source="../images/rotate_cw.png"/>
                </Button>
                <Button x:Name="RotCCw" Width="50" Margin="0,0,10,0" Click="RotCCw_Click" ToolTip="Rotate Counter clock wise">
                    <Image Source="../images/rotate_ccw.png"/>
                </Button>
                <Button x:Name="FlipY"  Width="50" Margin="0,0,10,0" Click="FlipY_Click" ToolTip="Flip verticaly">
                    <Image Source="../images/flip_y.png"/>
                </Button>
                <Button x:Name="FlipX"  Width="50" Margin="0,0,10,0" Click="FlipX_Click"  ToolTip="Flip horizontaly">
                    <Image Source="../images/flip_x.png"/>
                </Button>
                <ToggleButton x:Name="FullView" Width="50" Margin="0,0,10,0" Click="FullView_Click" ToolTip="Full view">
                    <Image Source="../images/viewmagfit.png"/>
                </ToggleButton>
            </StackPanel>

        </Grid>
       
        <StackPanel Grid.Row="2" HorizontalAlignment="Left" Orientation="Horizontal" VerticalAlignment="Center">
            <TextBlock Foreground="White" Text="Item:" Width="40" Margin="10,0,0,0"/>
			<TextBlock x:Name="ImgCounter" Foreground="White" Text="0000 / 0000" Width="70"/>
            <TextBlock x:Name="ImgFilename" Margin="10,0,0,0" Text="" Foreground="White" Width="auto"/>
        </StackPanel>
        
    </Grid>
</UserControl>
